Optimal. Leaf size=136 \[ -\frac{\sqrt{a+c x^2} \left (2 \left (2 a f h^2+c \left (f g^2-3 h (d h+e g)\right )\right )+c h x (f g-3 e h)\right )}{6 c^2 h}+\frac{\tanh ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a+c x^2}}\right ) (2 c d g-a (e h+f g))}{2 c^{3/2}}+\frac{f \sqrt{a+c x^2} (g+h x)^2}{3 c h} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.178773, antiderivative size = 135, normalized size of antiderivative = 0.99, number of steps used = 4, number of rules used = 4, integrand size = 27, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.148, Rules used = {1654, 780, 217, 206} \[ -\frac{\sqrt{a+c x^2} \left (2 \left (2 a f h^2-3 c h (d h+e g)+c f g^2\right )+c h x (f g-3 e h)\right )}{6 c^2 h}+\frac{\tanh ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a+c x^2}}\right ) (2 c d g-a (e h+f g))}{2 c^{3/2}}+\frac{f \sqrt{a+c x^2} (g+h x)^2}{3 c h} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 1654
Rule 780
Rule 217
Rule 206
Rubi steps
\begin{align*} \int \frac{(g+h x) \left (d+e x+f x^2\right )}{\sqrt{a+c x^2}} \, dx &=\frac{f (g+h x)^2 \sqrt{a+c x^2}}{3 c h}+\frac{\int \frac{(g+h x) \left ((3 c d-2 a f) h^2-c h (f g-3 e h) x\right )}{\sqrt{a+c x^2}} \, dx}{3 c h^2}\\ &=\frac{f (g+h x)^2 \sqrt{a+c x^2}}{3 c h}-\frac{\left (2 \left (c f g^2+2 a f h^2-3 c h (e g+d h)\right )+c h (f g-3 e h) x\right ) \sqrt{a+c x^2}}{6 c^2 h}+\frac{(2 c d g-a f g-a e h) \int \frac{1}{\sqrt{a+c x^2}} \, dx}{2 c}\\ &=\frac{f (g+h x)^2 \sqrt{a+c x^2}}{3 c h}-\frac{\left (2 \left (c f g^2+2 a f h^2-3 c h (e g+d h)\right )+c h (f g-3 e h) x\right ) \sqrt{a+c x^2}}{6 c^2 h}+\frac{(2 c d g-a f g-a e h) \operatorname{Subst}\left (\int \frac{1}{1-c x^2} \, dx,x,\frac{x}{\sqrt{a+c x^2}}\right )}{2 c}\\ &=\frac{f (g+h x)^2 \sqrt{a+c x^2}}{3 c h}-\frac{\left (2 \left (c f g^2+2 a f h^2-3 c h (e g+d h)\right )+c h (f g-3 e h) x\right ) \sqrt{a+c x^2}}{6 c^2 h}+\frac{(2 c d g-a (f g+e h)) \tanh ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a+c x^2}}\right )}{2 c^{3/2}}\\ \end{align*}
Mathematica [A] time = 0.113045, size = 96, normalized size = 0.71 \[ \frac{\sqrt{a+c x^2} \left (c \left (6 d h+6 e g+3 e h x+3 f g x+2 f h x^2\right )-4 a f h\right )+3 \sqrt{c} \tanh ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a+c x^2}}\right ) (2 c d g-a (e h+f g))}{6 c^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.055, size = 172, normalized size = 1.3 \begin{align*}{\frac{fh{x}^{2}}{3\,c}\sqrt{c{x}^{2}+a}}-{\frac{2\,afh}{3\,{c}^{2}}\sqrt{c{x}^{2}+a}}+{\frac{ehx}{2\,c}\sqrt{c{x}^{2}+a}}+{\frac{fgx}{2\,c}\sqrt{c{x}^{2}+a}}-{\frac{aeh}{2}\ln \left ( x\sqrt{c}+\sqrt{c{x}^{2}+a} \right ){c}^{-{\frac{3}{2}}}}-{\frac{afg}{2}\ln \left ( x\sqrt{c}+\sqrt{c{x}^{2}+a} \right ){c}^{-{\frac{3}{2}}}}+{\frac{dh}{c}\sqrt{c{x}^{2}+a}}+{\frac{eg}{c}\sqrt{c{x}^{2}+a}}+{dg\ln \left ( x\sqrt{c}+\sqrt{c{x}^{2}+a} \right ){\frac{1}{\sqrt{c}}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.20611, size = 482, normalized size = 3.54 \begin{align*} \left [\frac{3 \,{\left (a e h -{\left (2 \, c d - a f\right )} g\right )} \sqrt{c} \log \left (-2 \, c x^{2} + 2 \, \sqrt{c x^{2} + a} \sqrt{c} x - a\right ) + 2 \,{\left (2 \, c f h x^{2} + 6 \, c e g + 2 \,{\left (3 \, c d - 2 \, a f\right )} h + 3 \,{\left (c f g + c e h\right )} x\right )} \sqrt{c x^{2} + a}}{12 \, c^{2}}, \frac{3 \,{\left (a e h -{\left (2 \, c d - a f\right )} g\right )} \sqrt{-c} \arctan \left (\frac{\sqrt{-c} x}{\sqrt{c x^{2} + a}}\right ) +{\left (2 \, c f h x^{2} + 6 \, c e g + 2 \,{\left (3 \, c d - 2 \, a f\right )} h + 3 \,{\left (c f g + c e h\right )} x\right )} \sqrt{c x^{2} + a}}{6 \, c^{2}}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 7.04748, size = 282, normalized size = 2.07 \begin{align*} \frac{\sqrt{a} e h x \sqrt{1 + \frac{c x^{2}}{a}}}{2 c} + \frac{\sqrt{a} f g x \sqrt{1 + \frac{c x^{2}}{a}}}{2 c} - \frac{a e h \operatorname{asinh}{\left (\frac{\sqrt{c} x}{\sqrt{a}} \right )}}{2 c^{\frac{3}{2}}} - \frac{a f g \operatorname{asinh}{\left (\frac{\sqrt{c} x}{\sqrt{a}} \right )}}{2 c^{\frac{3}{2}}} + d g \left (\begin{cases} \frac{\sqrt{- \frac{a}{c}} \operatorname{asin}{\left (x \sqrt{- \frac{c}{a}} \right )}}{\sqrt{a}} & \text{for}\: a > 0 \wedge c < 0 \\\frac{\sqrt{\frac{a}{c}} \operatorname{asinh}{\left (x \sqrt{\frac{c}{a}} \right )}}{\sqrt{a}} & \text{for}\: a > 0 \wedge c > 0 \\\frac{\sqrt{- \frac{a}{c}} \operatorname{acosh}{\left (x \sqrt{- \frac{c}{a}} \right )}}{\sqrt{- a}} & \text{for}\: c > 0 \wedge a < 0 \end{cases}\right ) + d h \left (\begin{cases} \frac{x^{2}}{2 \sqrt{a}} & \text{for}\: c = 0 \\\frac{\sqrt{a + c x^{2}}}{c} & \text{otherwise} \end{cases}\right ) + e g \left (\begin{cases} \frac{x^{2}}{2 \sqrt{a}} & \text{for}\: c = 0 \\\frac{\sqrt{a + c x^{2}}}{c} & \text{otherwise} \end{cases}\right ) + f h \left (\begin{cases} - \frac{2 a \sqrt{a + c x^{2}}}{3 c^{2}} + \frac{x^{2} \sqrt{a + c x^{2}}}{3 c} & \text{for}\: c \neq 0 \\\frac{x^{4}}{4 \sqrt{a}} & \text{otherwise} \end{cases}\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.2111, size = 149, normalized size = 1.1 \begin{align*} \frac{1}{6} \, \sqrt{c x^{2} + a}{\left ({\left (\frac{2 \, f h x}{c} + \frac{3 \,{\left (c^{2} f g + c^{2} h e\right )}}{c^{3}}\right )} x + \frac{2 \,{\left (3 \, c^{2} d h - 2 \, a c f h + 3 \, c^{2} g e\right )}}{c^{3}}\right )} - \frac{{\left (2 \, c d g - a f g - a h e\right )} \log \left ({\left | -\sqrt{c} x + \sqrt{c x^{2} + a} \right |}\right )}{2 \, c^{\frac{3}{2}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]